package reese.springmvc.mvc_01_handlerMapping;

import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
import reese.controller.mvc_01_handlerMapping.MaiDiGuaController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * ***********************************************************
 *
 * @类名 : reese.springmvc.mvc_01_handlerMapping.类名
 * @DESCRIPTION : 这家伙太懒啥都没写
 * @AUTHOR :  一个风情万种的男子
 * @DATE : 2016/4/27
 * ***********************************************************
 */
public class MaiDiGuaHandlerAdapter implements HandlerAdapter {
    public boolean supports(Object handler) {
        return handler instanceof MaiDiGuaController;
    }

    public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        //FIXME 这里的很关键,将object类型的handler转换为Controller类
        return ((MaiDiGuaController)handler).maiDiGua(request,response);
    }

    public long getLastModified(HttpServletRequest request, Object handler) {
        return 0;
    }
}
